<? include ("../init.php") ?>
<? include ("../header.php") ?>
<? include ("../menu.php") ?>
<? include ("submenu.php") ?>

<div id = "body">

<h1><?_l('Product')?></h1>

<a href = "product_form.php" class = "add">
  <img src = "<?=ADMIN?>/images/icon-add.png">&nbsp;&nbsp;&nbsp;<?_l('Add Product')?>
</a>

<a href = "product_import.php" class = "add">
  &nbsp;&nbsp;&nbsp;<img style="width:12px;" src = "<?=ADMIN?>/images/import.png">&nbsp;&nbsp;&nbsp;<?_l('Import')?>
</a>

<!--<a href = "product_export.php" class = "add">-->
<!--  &nbsp;&nbsp;&nbsp;<img style="width:12px;" src = "<?=ADMIN?>/images/export.png">&nbsp;&nbsp;&nbsp;<?_l('Export')?>-->
<!--</a>-->

<div class = "clear"></div>

<div class = "page">
<?
  $count = $db->countOfAll('hs_product');
  $start = setpage($count);
?>
</div>

<div class = "clear"></div>

<table class ="list">
  <tr>
    <th scope="col"><?_l('style number')?></th>
    <th scope="col"><?_l('category')?></th>
    <th scope="col" width = "120"><?_l('status')?></th>
    <th scope="col" width = "50"><?_l('edit')?></th>
    <th scope="col" width = "50"><?_l('delete')?></th>
  </tr>
<?
  $rss = $db->query("SELECT hs_product.*,hs_category.c_name FROM hs_product LEFT JOIN hs_category ON(hs_product.c_id=hs_category.c_id) ORDER BY hs_product.p_style_number , hs_category.c_name LIMIT $start,".PAGE);
  while ($line = $db->fetchNextObject($rss)){
?>
  <tr>
    <td><?php echo strtoupper($line->p_style_number); ?></td>
    <td><?php echo $line->c_name; ?></td>
    <td><?php if($line->p_active==1){ echo 'Active'; }else{ echo 'Unactive'; }?></td>
    <td><a href = "product_edit.php?aid=<?=$line->p_id?>" class = "btn"><?_l('edit')?></a></td>
    <td><a href = "product_delete.php?aid=<?=$line->p_id?>" class = "btn" onClick = "return confirmSubmit()"><?_l('delete')?></a></td>
  </tr>
<?
  }
?>
</table>

</div>

<style>

</style>

<? include "../footer.php" ?>